﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace kongjian15
{
    [Designer(typeof(TongJi_EMS._TJ_Basic.TJ_BasicControlDesigner))]
    public partial class sanxiangdianya : TongJi_EMS._TJ_Basic.TJ_BasicControl
    {
        public sanxiangdianya()
        {
            InitializeComponent();
        }
        private string faultSignal = "0";//故障信号
        [CategoryAttribute("Data")]
        [Description("变压器故障信号，0为正常状态，1为故障状态")]
        public string FaultSignal
        {
            get { return faultSignal; }
            set { faultSignal = value; }

        }
        private void sanxiangdianya_Paint(object sender, PaintEventArgs e)
        {

            Pen a = new Pen(Color.Red, 1);
            e.Graphics.DrawEllipse(a, x - y * 2f / 3.5f, y*2.5f/35f, y * 4f / 3.5f, y * 4f / 3.5f);
            e.Graphics.DrawEllipse(a, y*2f/35f,y*4f/5f, y * 4f / 3.5f, y * 4f / 3.5f);
            e.Graphics.DrawEllipse(a, y*4f/5f, y * 4f / 5f, y * 4f / 3.5f, y * 4f / 3.5f);
            e.Graphics.DrawLine(a, 0, y * 2f / 3.5f, x, y * 2f / 3.5f);
            e.Graphics.DrawLine(a, x, y * 2f / 3.5f, x, y * 6f / 7f);
            e.Graphics.DrawLine(a, x-y*0.2f, y *0.36f, x, y * 2f / 3.5f);
            e.Graphics.DrawLine(a, x +y * 0.2f, y * 0.36f, x, y * 2f / 3.5f);
            e.Graphics.DrawLine(a, x*20f/35f, y * 50f/35f, x*20f/35f, y * 60f / 35f);
            e.Graphics.DrawLine(a, x * 20f / 35f-y*1.732f/7f, y * 41f / 35f, x * 20f / 35f, y * 50f / 35f);
            e.Graphics.DrawLine(a, x * 20f / 35f + y * 1.732f / 7f, y * 41f / 35f, x * 20f / 35f, y * 50f / 35f);
            e.Graphics.DrawLine(a, x + y * 0.2f, y * 58f / 35f, x + y * 0.75f, y * 58f / 35f);
            e.Graphics.DrawLine(a, x + y * 0.2f, y * 58f / 35f, x + y*1.5f/3.5f, y * 1.25f);
            e.Graphics.DrawLine(a, x + y * 1.9f / 3.5f, y * 1.25f, x + y * 0.75f, y * 58f / 35f);

            Pen c = new Pen(Color.White, 3);
            if (faultSignal == "1")
            {

                e.Graphics.DrawRectangle(c, x * 0.1f, y * 0.1f, x * 1.8f, y * 1.8f);

            }
           
        }

        private void sanxiangdianya_Resize(object sender, EventArgs e)
        {
            this.x = this.Width / 2;
            this.y = this.Height / 2;
            //this.Refresh();

        }

        private void sanxiangdianya_Load(object sender, EventArgs e)
        {
            sanxiangdianya_Resize(sender, e);
        }
        private string dianya_Ua, dianya_Ub, dianya_Uc, dianya_diyu, dianya_gaoyu, dianya_dibao, dianya_gaobao;
        /// <summary>
        /// 获取或设置三相电流值
        /// </summary>
        [Category("自定义"), Description("获取或设置电压值的提示信息")]
        public string Dianya_Ua
        {
            get { return dianya_Ua; }
            set { dianya_Ua = value; }

        }
        [Category("自定义"), Description("获取或设置电压值的提示信息")]
        public string Dianya_Ub
        {
            get { return dianya_Ub; }
            set { dianya_Ub = value; }

        }
        [Category("自定义"), Description("获取或设置电压值的提示信息")]
        public string Dianya_Uc
        {
            get { return dianya_Uc; }
            set { dianya_Uc = value; }

        }

    }
}